const { app, BrowserWindow, ipcMain } = require('electron');
const cmd = require("node-cmd")
var mainWindow;

const ipc = ipcMain;


/**
 * 主线程
 */
app.on('ready', () => {
    mainWindow = new BrowserWindow({
        width: 600,
        height: 400,
        webPreferences: {
            nodeIntegration: true,
            contextIsolation: false
        }
    })

    /**
     * 创建主窗口
     */
    mainWindow.webContents.openDevTools()
    mainWindow.loadFile('./index.html')


    mainWindow.on('closed', () => {
        mainWindow = null
    })


})

app.on('window-all-closed', () => {
    app.quit()
})

module.exports = mainWindow;
